# src/httpserver/CMakeLists.txt

# 添加包含目录
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

# 查找源文件
file(GLOB HTTPSERVER_SOURCES
    "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
)

# 添加静态库目标
add_library(httpserver STATIC ${HTTPSERVER_SOURCES})

target_include_directories(
    httpserver 
    PRIVATE ${CMAKE_SOURCE_DIR}/src/
    PRIVATE ${CMAKE_SOURCE_DIR}/src/dto
    PRIVATE ${CMAKE_BINARY_DIR}/mongoose/include
    PRIVATE ${CMAKE_SOURCE_DIR}/src/utils/include
    PRIVATE ${CMAKE_SOURCE_DIR}/src/config/include
    PRIVATE ${CMAKE_SOURCE_DIR}/src/httpservice/include
    PRIVATE ${CMAKE_SOURCE_DIR}/src/streamproxy/include
)

# 链接mongoose库
target_link_libraries(httpserver PRIVATE 
    ${OPENSSL_LIBRARIES}
    ${LIVE555_LIBS}
    nlohmann_json::nlohmann_json
    mongoose
    config
    httpservice
    utils
)
